-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add current element to in-element #1575
base: main
Are you sure you want to change the base?
add current element to in-element #1575
Conversation
Sorry we didn't get to address this before the other PR was merged. Ultimately I am not sure what you're looking to accomplish is inline with the type of information the DRT is aiming to provide. It just provides the logical hierarchy the successor to/replacement for the "view tree/parent-child views chain" in classic components. In this view the The type of views that you are looking to assemble seems like a better fit for some kind of source maps/source location linkage where you can tie things back closer to the original template source as-written. Even if you have the parent element, you still won't have the relative ordering within the parent, that you happen to be able to infer in the other cases (you'll basically need a collapsed bounds of some sort – which is not information we have): <div>
<First />
<Second />
{{#in-element}}...{{/in-element}} <-- you can't place this here
<Third />
</div> My preference would be to dissuade you from trying to group the tree that way (other than for modifiers, which I get that you have to attach it to something to make sense). However, if I cannot convince you of that, I would much prefer adding a metadata bag than hacking/hijacking the Also just know that we may not always be able to provide this information, especially if, in the future, the code/timing moved around such that, e.g. the modifiers are constructed completely asynchronously and we don't have it the parent element handy in that spot in the code, we are not going to go out of the way to thread that information if it's expensive/hugely inconvenient in the new code. |
alright. <div>
<First />
<Second />
{{#in-element}}...{{/in-element}} <-- you can't place this here
<Third />
</div> Why not? The ordering is already like that in the debug render tree. how can i add metadata? |
dang, that looks real nice @patricklx 🎉 |
On a side note: i actually would like to have all blocks rendered:) like, each, let, if. |
eb09c8b
to
e6ba8a7
Compare
@chancancode can you have another look? |
33b496c
to
c2f25b4
Compare
c2f25b4
to
22d9e4b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.